-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pause render hotkey #6104
base: 1.5_maintenance
Are you sure you want to change the base?
Pause render hotkey #6104
Conversation
This will be really useful, thanks @ericmehl. In case it is relevant, we have a ticket on our side to auto-pause all renders and scene expansion when a free-memory lower limit is reached. The idea being to avoid killing your machine if you accidentally expand all on a scene of significant complexity. Wondered if there would be any interest in a more public API for managing 'ongoing expansion/rendering tasks' without needing to know the specifics of the particular view implementations, etc. |
We did toy with the idea of a global |
Quote of the day that summarises it nicely:
|
@tomc-cinesite, do you think it's worth taking a bit more time on this to make the "universal panic signal" thing, or is this worthwhile enough in its own right? We don't think the signal represents a lot more work - say a day maybe? |
Its pretty high on our list to make a big red help button for people and connect it to a memory watcher. So if you happend to feel so inclined as to make us a lovely panic API method we can call and hook ESC up to it, that would certainly make our lives easier 🙏 Thanking you most kindly. |
@tomc-cinesite I'll probably roll the global pause signal into this PR to help get your memory watcher feature off the ground. A few questions about what you would find the most useful. When the signal is emitted (by pressing the Escape key most likely) : What should be paused? IPR renders for sure. And everything else too? Hierarchy views, scene inspectors and primitive inspectors, among others, can all trigger high resource and memory usage so we're thinking those should get paused. How would you want to get out of the paused state? We're considering an un-pause button on the script window that would end this global paused state. That way we wouldn't need lots of un-pause buttons throughout the UI that all need to be pushed. Would you want the global un-pause button to leave IPR renders (the ones that were paused as a result of the global pause signal) paused, or un-pause them? And I expect it would be desirable to apply this application-wide, so it would pause things in all open scripts. Would pressing un-pause apply to the window holding the button only, or to all open script windows in the application session? Thanks for any advisement you can offer! |
@ericmehl Excellent questions. Per-script please! Making unpause unpause all the things that it paused all together would be 👌 Thanks so much. |
This adds
Escape
as a hotkey to pause the render, as well as pausing the viewport updates (which was already the behavior). It also adds a hotkey,Control
+\
, to pause and start the render. Both need to have the viewer as the focus widget.Finally, aiming to match the hotkey behavior, I added a commit to unpause the viewer when the play button is pushed.
I tested this with Arnold, adding a high number of subdivisions to the Gafferbot meshes. Pausing worked fairly well - it still takes a few seconds on my machine to get it to pause. We're already using Arnold's
AiRenderInterrupt()
which from their documentation sounds like the most appropriate method for what we want to do.It seems like that needs to wait for the current batch of meshes to finish subdividing, then it pauses. Adding more subdivisions increases the time it takes for Arnold to pause.
There's also the issue of pausing the render before the renderer actually begins. Talking yesterday about this, that would require shifting some scene processing to a background thread so the UI thread is unlocked. We discussed that being a follow-up to this PR rather than including it now.
Checklist